package com.woniuxy.service.imp;

import com.woniuxy.dao.UserMapper;
import com.woniuxy.model.User;
import com.woniuxy.service.UserService;
import com.woniuxy.util.SqlSessionUtil;

public class UserServiceImpl implements UserService {
    @Override
    public String login(String name, String pwd) {
        String str = "";
        UserMapper mapper = SqlSessionUtil.getMapper(UserMapper.class);
        User user = mapper.getUser(name);
        if (user!=null){
            if (user.getPassword().equals(pwd)){
                str = "登陆成功！";
            }else {
                str = "密码错误！";
            }
        }else{
            str = "找不到用户";
        }


        return str;
    }
}
